package ar.edu.siglo21.taller.algoritmo.utils;

public class ValidarDatos {

	private static String PUNTO_COM = ".com";
	private static String ARROBA = "@";
	/**
	 * @param args
	 */
	public static boolean name(String nombre) {
		if (nombre == null || nombre.trim().equals("")) {
			return false;
		}
		if (nombre.length() < 2) {
			return false;
		}
		return true;
	}

	public static boolean validarEmail(String email) {
		boolean emailValido = false;
		
		if(email.contains(ARROBA) && email.endsWith(PUNTO_COM)){
			emailValido = true;
		}
		return emailValido;
	}
	public static boolean validarNombre(String firstName) {
		return firstName.matches("[A-Z][a-zA-Z]*");
	}

	public static boolean validarApellido(String lastName) {
		return lastName.matches("[a-zA-z]+([ '-][a-zA-Z]+)*");
	}
	
}
